/*
 * ConfiguracionVentana.java
 *
 */

package ar.com.educacionit.vehiculos.ventanas;

/**
 *
 * @author  Sebastian S. Sanga <SebastianSanga@gmail.com>
 */
public class ConfiguracionVentana extends javax.swing.JInternalFrame {
    
    // Atributo para manejar si hay una ventana abierta de este tipo
    public static boolean abierta = false;
    
    public ConfiguracionVentana() {
        
        // Llama al constructor de la superclase y establece las caracteristicas de ventana
        super("Configuracion",
          true, //resizable
          true, //closable
          true, //maximizable
          true);//iconifiable
        
        // Establece en true el atributo abierto representando que hay una ventana de este tipo abierta
        abierta = true;
        
        // Invoca al metodo initComponents()
        initComponents();    
        
        // Carga los datos de la configuracion
        cargarDatos();
    }    
    
    public void cargarDatos(){
        txtSistemaOperativo.setText( System.getProperty("os.name") );
        txtVersionSistemaOperativo.setText( System.getProperty("os.version") );
        txtUsuario.setText( System.getProperty("user.name") );
        txtVersionJava.setText( System.getProperty("java.version") );
    }
    
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        txtSistemaOperativo = new javax.swing.JTextField();
        txtUsuario = new javax.swing.JTextField();
        txtVersionJava = new javax.swing.JTextField();
        btnCerrar = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        txtVersionSistemaOperativo = new javax.swing.JTextField();

        jLabel1.setText("Sistema Operativo");

        jLabel2.setText("Usuario");

        jLabel3.setText("Version de Java");

        txtSistemaOperativo.setEditable(false);

        txtUsuario.setEditable(false);

        txtVersionJava.setEditable(false);

        btnCerrar.setText("Cerrar");
        btnCerrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCerrarActionPerformed(evt);
            }
        });

        jLabel4.setText("Version Sistema Operativo");

        txtVersionSistemaOperativo.setEditable(false);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(jLabel3)
                            .add(jLabel2)
                            .add(jLabel1)
                            .add(jLabel4))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 14, Short.MAX_VALUE)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                            .add(txtVersionJava)
                            .add(txtVersionSistemaOperativo)
                            .add(txtSistemaOperativo, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 228, Short.MAX_VALUE)
                            .add(txtUsuario))
                        .add(18, 18, 18))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                        .add(btnCerrar)
                        .addContainerGap())))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(27, 27, 27)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(txtSistemaOperativo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel1))
                .add(17, 17, 17)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel4)
                    .add(txtVersionSistemaOperativo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(16, 16, 16)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(txtUsuario, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel2))
                .add(17, 17, 17)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel3)
                    .add(txtVersionJava, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(85, 85, 85)
                .add(btnCerrar)
                .add(20, 20, 20))
        );
        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnCerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCerrarActionPerformed
        this.dispose();
    }//GEN-LAST:event_btnCerrarActionPerformed
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCerrar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JTextField txtSistemaOperativo;
    private javax.swing.JTextField txtUsuario;
    private javax.swing.JTextField txtVersionJava;
    private javax.swing.JTextField txtVersionSistemaOperativo;
    // End of variables declaration//GEN-END:variables
    
}
